package com.controlstudent.android.app;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.controlstudent.android.app.entidades.Alumno;
import java.util.List;

/**
 *
 * @author User
 */
public class ListaAlumnosAdapter extends BaseAdapter{

    private final Context mContext;
    private final List<Alumno> alumnos;

    public ListaAlumnosAdapter (Context mContext, List<Alumno> alumnos) {
        this.mContext = mContext;
        this.alumnos = alumnos;
    }
    
    public int getCount() {
        return alumnos.size();
    }

    public Alumno getItem(int position) {
        return alumnos.get(position);
    }

    public long getItemId(int position) {
        return position;
    }

    public View getView(int position, View convertView, ViewGroup parent) {
        Alumno item = alumnos.get(position);

        View v = View.inflate(mContext, R.layout.listalumnos_item, null);

        TextView lblHotel = (TextView)v.findViewById(R.id.tv_nom_alum);
        lblHotel.setText(item.getAlum_ape());


        
        return v;
    }   
}